<?php
/**
 * Pimcore
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.pimcore.org/license
 *
 * @copyright  Copyright (c) 2009-2010 elements.at New Media Solutions GmbH (http://www.elements.at)
 * @license    http://www.pimcore.org/license     New BSD License
 */

error_reporting(E_ALL ^ E_NOTICE);

// configure some constants needed by pimcore
$coreDocumentRoot = realpath(dirname(__FILE__) . '/../..');
$coreAppRoot = realpath(dirname(__FILE__) . '/..');

if (!defined("CORE_DOCUMENT_ROOT"))  define("CORE_DOCUMENT_ROOT", $coreDocumentRoot);
if (!defined("CORE_APP_ROOT"))  define("CORE_APP_ROOT", $coreAppRoot);
if (!defined("CORE_CONFIGURATION_DIRECTORY"))  define("CORE_CONFIGURATION_DIRECTORY", $coreAppRoot . '/config');
if (!defined("CORE_VAR_DIRECTORY"))  define("CORE_VAR_DIRECTORY", $coreDocumentRoot . '/var');


if (!defined("CORE_PATH"))  define("CORE_PATH", CORE_DOCUMENT_ROOT);
if (!defined("MODULE_PATH"))  define("MODULE_PATH", CORE_APP_ROOT . '/modules');
if (!defined("MODEL_PATH"))  define("MODEL_PATH", CORE_APP_ROOT . '/models');

if (!defined("LIB_PATH"))  define("LIB_PATH", CORE_DOCUMENT_ROOT . '/library');
if (!defined("CORE_COMMON_TEMPLATE"))  define("CORE_COMMON_TEMPLATE", CORE_APP_ROOT . '/common_tpl');
if (!defined("CORE_BLOCK_TEMPLATE"))  define("CORE_BLOCK_TEMPLATE", CORE_COMMON_TEMPLATE . '/blocks');
if (!defined("CORE_TEMPLATE"))  define("CORE_TEMPLATE", CORE_COMMON_TEMPLATE . '/includes');

if (!defined("CORE_CONFIGURATION_SYSTEM"))  define("CORE_CONFIGURATION_SYSTEM", CORE_CONFIGURATION_DIRECTORY . "/system.xml");
if (!defined("CORE_ASSET_DIRECTORY"))  define("CORE_ASSET_DIRECTORY", CORE_VAR_DIRECTORY . "/assets");
//if (!defined("CORE_STATIC_DIRECTORY"))  define("CORE_STATIC_DIRECTORY", CORE_VAR_DIRECTORY . "/static");
if (!defined("CORE_ASSET_CMS_DIRECTORY"))  define("CORE_ASSET_CMS_DIRECTORY", CORE_ASSET_DIRECTORY . "/cms");
if (!defined("CORE_LOG_DEBUG"))  define("CORE_LOG_DEBUG", CORE_VAR_DIRECTORY . "/log/debug.log");
if (!defined("CORE_TEMPORARY_DIRECTORY"))  define("CORE_TEMPORARY_DIRECTORY", CORE_VAR_DIRECTORY . "/tmp");
if (!defined("CORE_CACHE_DIRECTORY"))  define("CORE_CACHE_DIRECTORY", CORE_VAR_DIRECTORY . "/cache");


if (!defined("STATIC_WEB_ROOT"))  define("STATIC_WEB_ROOT", '/public');
if (!defined("STATIC_IMAGE_WEB_ROOT"))  define("STATIC_IMAGE_WEB_ROOT", STATIC_WEB_ROOT.'/images');
if (!defined("STATIC_JS_WEB_ROOT"))  define("STATIC_JS_WEB_ROOT", STATIC_WEB_ROOT.'/js');
if (!defined("STATIC_CSS_WEB_ROOT"))  define("STATIC_CSS_WEB_ROOT", STATIC_WEB_ROOT.'/css');


if (!defined("VAR_WEB_ROOT"))  define("VAR_WEB_ROOT", '/var');
if (!defined("VAR_ASSET_WEB_ROOT"))  define("VAR_ASSET_WEB_ROOT", VAR_WEB_ROOT.'/assets');
if (!defined("VAR_CMS_WEB_ROOT"))  define("VAR_CMS_WEB_ROOT", VAR_ASSET_WEB_ROOT.'/cms');


$includePaths = array(
    CORE_DOCUMENT_ROOT . "/library",
//    CORE_APP_ROOT . "/models"
);
set_include_path(implode(PATH_SEPARATOR, $includePaths));

// helper functions
include(dirname(__FILE__) . "/helper.php");

// setup zend framework and core
require_once "Bootstrap.php";
require_once "Logger.php";
/*require_once "Zend/Loader/AutoloaderFactory.php";


Zend\Loader\AutoloaderFactory::factory(array(
    'Zend\Loader\ClassMapAutoloader'=>array(LIB_PATH.'/Zend/autoload_classmap')));*/

/*,
'Zend\Loader\StandardAutoloader'=>array('namespaces'=> array(
    'MyNamespace' => __DIR__ . '/MyNamespace'))));*/


/*$autoloader = Zend_Loader_Autoloader::getInstance();
$autoloader->registerNamespace('Pimcore');
$autoloader->suppressNotFoundWarnings(false);*/

// on pimcore shutdown
//register_shutdown_function("Pimcore::shutdown");

